<?php
class FotoGallery extends DB_Table {
    // We'll add more here later in the tutorial,
    // but for now this is all we need.  (Look,
    // ma, no constructor!)
	
	var $col = array(
        
        // unique row ID
        'id' => array(
            'type'    => 'integer',
            'require' => true
        ),
        
        // title
        'title' => array(
            'type'    => 'varchar',
            'size'    => 32
        ),
        
        // description
        'description' => array(
            'type'    => 'varchar',
			'size'    => 254            
        ),
        
        // email address
        'img_url' => array(
            'type'    => 'varchar',
            'size'    => 254,
            'require' => true
        ),
        
        // date-time signed
        'signdate' => array(
            'type'    => 'date',
            'require' => true
        )
    );
   
   var $idx = array(
        'id' => array(
            'type' => 'unique',
            'cols' => 'id'
        ),
        'signdate' => array(
            'type' => 'normal',
            'cols' => 'signdate'
        )
    );

var $sql = array(
        
        // multiple rows for a list
        'list' => array(
            'select' => "id, signdate, title, description, img_url",
            'order'  => 'signdate DESC'
        ),
        
        // one row for an item detail
        'item' => array(
            'select' => 'id, title, description, signdate, img_url',
            'get'    => 'row'
        )
        
       
    );

	
}
?>
